package hu.magyusz.mailhide.tag;

import hu.magyusz.mailhide.util.MailHideUtils;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class MailHideTag extends SimpleTagSupport {

    protected String email;

    protected String pubKey;
    
    protected String privKey;


    @Override
    public void doTag() throws JspException, IOException {
        String url = MailHideUtils.getUrl(privKey, pubKey, email);
        
        getJspContext().getOut().write(url);
    }


    public String getEmail() {
        return email;
    }


    public void setEmail(String email) {
        this.email = email;
    }


    public String getPubKey() {
        return pubKey;
    }


    public void setPubKey(String pubKey) {
        this.pubKey = pubKey;
    }


    public String getPrivKey() {
        return privKey;
    }


    public void setPrivKey(String privKey) {
        this.privKey = privKey;
    }
}
